package com.guashu.springbootasynchronous;

import com.guashu.springbootasynchronous.async.springApplicationEvent.CustomEventPublisher;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication
@EnableAsync // 开启异步支持
public class SpringbootAsynchronousApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootAsynchronousApplication.class, args);
//        ConfigurableApplicationContext context = SpringApplication.run(SpringbootAsynchronousApplication.class, args);
//        CustomEventPublisher customEventPublisher = context.getBean(CustomEventPublisher.class);
//        customEventPublisher.publishEvent("Hello, world!");
    }

}
